
import { tutorVerifyData,loadInfoStutrainInfo,loadSysParamListNoPage,loadAlDegree,loadAlDegreegraduInfo } from "../../services/mentor"
export default {

  namespace: 'degreeInformationModule',

  state: {
    tutorVerifyList:[],
    loadInfoStutrainList:[],
    loadSysParamlist:[],
    loadAlDeList:[],
    loadAlDegreegraduList:[],
    data:[]
  },

  effects: {
    *tutorVerify({ payload }, { call, put }) {
      let nav = yield tutorVerifyData(payload)
      yield put({
        type: 'tutorVerifyLi', payload: nav.rows
      });
    },
    *loadInfoStutrain({ payload }, { call, put }) {
      let nav = yield loadInfoStutrainInfo({id:payload.id})
      let nav1 = yield loadAlDegreegraduInfo({uniqueId:payload.uniqueId})
      let nav2 = yield loadAlDegree({...payload.types})
      yield put({
        type: 'loadAlDeSS', payload: {
          ...nav.data,
          ...nav1.data,
          ...nav2.data
        }
      });
    },
    *loadSysParamList({ payload }, { call, put }) {
      let nav = yield loadSysParamListNoPage(payload)
      yield put({
        type: 'loadSysParamlist', payload: nav
      });
    },
    *loadAlDegreegradu({ payload }, { call, put }) {
      
    },
    *loadAlDe({ payload }, { call, put }) {
      
    }
  },

  reducers: {
    tutorVerifyLi(state, { payload }) {
      state.tutorVerifyList = payload;
      return {
        ...state,
        ...payload,
      }
  },
  loadInfoStutrainS(state, { payload }) {
    state.loadInfoStutrainList = payload; 
    return {
      ...state,
      ...payload,
    }
  },
  loadSysParam(state, { payload }) {
    state.loadSysParamlist = payload;
    return {
      ...state,
      ...payload,
    }
  },
  loadAlDegreegraduS(state, { payload }) {
    state.loadAlDegreegraduList = payload;
    return {
      ...state,
      ...payload,
    }
  },
  loadAlDeSS(state, { payload }) {
    state.loadAlDeList = payload;
    return {
      ...state,
      ...payload,
    }
  }
}

};
